package DataGo;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Date10 {//增加年月日
    public static void main(String[] args) {
        LocalDateTime localDateTime= LocalDateTime.of(1010,2,23,12,2,3);
        LocalDateTime year= localDateTime.plusYears(1);
        System.out.println(year);
        DateTimeFormatter dateTimeFormatter=DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String L= year.format(dateTimeFormatter);
        System.out.println(L);
        LocalDateTime mouth=  localDateTime.plusMonths(2);
        System.out.println(mouth);
        LocalDateTime days=localDateTime.plusDays(3);
        System.out.println(days);
        LocalDate localDate= LocalDate.of(1010,2,23);
        String c="1010-12-12 ";
        DateTimeFormatter dateTimeFormatter1=DateTimeFormatter.ofPattern("yyyy-MM-dd ");
        LocalDate W= LocalDate.parse(c,dateTimeFormatter1);
        System.out.println(W);
    }
}
